from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    TeamViewSet,
    TeamMemberView,
    TeamSprintView,
    TeamDetailView,
    TeamTaskView,
    TeamRankingView
)

router = DefaultRouter()
router.register(r'teams', TeamViewSet, basename='team')

app_name = 'team'

urlpatterns = [
    path('', include(router.urls)),
    
    # 团队成员相关
    path('teams/<int:team_id>/members/', TeamMemberView.as_view(), name='team-members'),
    path('teams/<int:team_id>/members/<int:member_id>/', TeamMemberView.as_view(), name='team-member-detail'),
    
    # 冲刺相关
    path('teams/<int:team_id>/sprint/', TeamSprintView.as_view(), name='team-sprint'),
    
    # 团队详情
    path('teams/<int:team_id>/detail/', TeamDetailView.as_view(), name='team-detail'),
    
    # 团队任务
    path('teams/<int:team_id>/tasks/', TeamTaskView.as_view(), name='team-tasks'),
    path('teams/<int:team_id>/tasks/<int:task_id>/', TeamTaskView.as_view(), name='team-task-detail'),
    
    # 排行榜
    path('rankings/', TeamRankingView.as_view(), name='team-rankings'),
] 